

dic = {}
name = []

try:
    dic['name']
    name[0]
except Exception as e:
    print('出错了',e)